﻿Public Class FormSalary

    Private Sub FormSalary_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.dgv.DataSource = Cmd.ExecuteDataTable("SELECT TBL_EMPLOYEE .Employee_Id ,TBL_EMPLOYEE .Employee_Name,TBL_EMPLOYEE .Sex ,TBL_EMPLOYEE .Salary,TBL_CHECK .Check_in_Overtime,TBL_CHECK .Check_out_Overtime,TBL_CHECK.Active FROM TBL_EMPLOYEE INNER JOIN TBL_CHECK  ON TBL_CHECK .Employee_Id=TBL_EMPLOYEE .Employee_Id")
    End Sub

    Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
        LoadDataSalary()
    End Sub
    Private Sub LoadDataSalary()
        Cmd.Parameters("Employee_Name") = "%" & txtSearch.Text & "%"
        Me.dgv.DataSource = Cmd.ExecuteDataTable("SELECT TBL_EMPLOYEE .Employee_Id ,TBL_EMPLOYEE .Employee_Name,TBL_EMPLOYEE .Sex ,TBL_EMPLOYEE .Salary,TBL_CHECK .Check_in_Overtime,TBL_CHECK .Check_out_Overtime FROM TBL_EMPLOYEE INNER JOIN TBL_CHECK  ON TBL_CHECK .Employee_Id=TBL_EMPLOYEE .Employee_Id WHERE UPPER (Employee_Name) LIKE UPPER('%'+@Employee_Name+'%')")

    End Sub
End Class